package com.ayq.activiti.manager.service;

import com.ayq.activiti.common.util.PageParams;
import com.ayq.activiti.common.util.Ret;
import com.ayq.activiti.manager.domain.custom.entity.DisDeployment;
import org.activiti.engine.repository.Model;

import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.OutputStream;
import java.util.List;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

/**
 * <p>部署流程实例接口</p>
 * <p>方法名:</p>
 *
 * @Author ayq
 * @Date 2021/3/25 10:57
 */
public interface CustomDeploymentService {

    /**
     * <p>删除部署流程实例</p>
     * <p>方法名:deleteDeployment</p>
     *
     * @Author ayq
     * @Date 2021/3/25 10:59
     * @Param [id]
     * @Return void
     */
    void deleteDeployment(String id) throws Exception;

    /**
     * <p>强制删除部署流程</p>
     * <p>方法名:deleteRmDeployment</p>
     *
     * @Author ayq
     * @Date 2021/3/25 11:32
     * @Param [id]
     * @Return void
     */
    void deleteRmDeployment(String id) throws Exception;

    /**
     * <p>获取流程列表</p>
     * <p>方法名:deploymentList</p>
     *
     * @Author ayq
     * @Date 2021/3/25 11:03
     * @Param [pageParams]
     * @Return void
     */
    void deploymentList(PageParams pageParams);

    /**
     * <p>部署流程实例</p>
     * <p>方法名:deploy</p>
     *
     * @Author ayq
     * @Date 2021/3/25 11:14
     * @Param [id, zos, zis]
     * @Return void
     */
    void deploy(String id, ZipOutputStream zos, ZipInputStream zis) throws Exception;

    /**
     * <p>根据部署流程ID查看模型流程</p>
     * <p>方法名:findModelToDid</p>
     *
     * @Author ayq
     * @Date 2021/3/25 11:19
     * @Param [deploymentId]
     * @Return org.activiti.engine.repository.Model
     */
    Model findModelToDid(String deploymentId);

    /**
     * <p>根据部署ID查看流程图</p>
     * <p>方法名:getDeploymentIdBpmnImgs</p>
     *
     * @Author ayq
     * @Date 2021/3/25 11:24
     * @Param [deploymentId, resourceName, resp]
     * @Return void
     */
    void getDeploymentIdBpmnImgs(String deploymentId, String resourceName, HttpServletResponse resp) throws Exception;

    /**
     * <p>根据部署ID查看流程信息</p>
     * <p>方法名:getDeploymentIdBpmnXml</p>
     *
     * @Author ayq
     * @Date 2021/3/25 14:25
     * @Param [deploymentId, resourceName]
     * @Return java.lang.String
     */
    String getDeploymentIdBpmnXml(String deploymentId, String resourceName) throws Exception;

    /**
     * <p>设置部署流程实例状态</p>
     * <p>方法名:setSuspended</p>
     *
     * @Author ayq
     * @Date 2021/3/25 17:35
     * @Param [key, status]
     * @Return boolean
     */
    boolean setSuspended(String key, boolean status);

    /**
     *
     * <p>获取流程所有版本</p>
     * <p>方法名:deploymentAllListVersion</p>
     * @Author ayq
     * @Date 2021/3/26 15:45
     * @Param [pageParams,key]
     * @Return void
     */
    void deploymentAllListVersion(PageParams pageParams, String key);


    /**
     * <p>模型文件下载</p>
     * <p>方法名:exportActivitiZip</p>
     * @Author ayq
     * @Date 2021/3/26 17:30
     * @Param [resourceName, res, bis, os]
     * @Return void
     */
    void exportActivitiZip(String resourceName, HttpServletResponse res, BufferedInputStream bis, OutputStream os) throws Exception;



    /**
     *
     * <p>获取部署列表</p>
     * <p>方法名:deploymentAllList</p>
     * @Author ayq
     * @Date 2021/3/30 17:50
     * @Param []
     * @Return java.util.List<org.ezca.esign.service.activiti.domain.custom.entity.DisDeployment>
     */
    List<DisDeployment> deploymentAllList();

    /**
     *
     * <p>根据流程key获取流程版本</p>
     * <p>方法名:getVersionByKey</p>
     * @Author ayq
     * @Date 2021/3/31 11:46
     * @Param [key]
     * @Return java.util.List<java.lang.Integer>
     */
    List<Integer> getVersionByKey(String key);
}
